package com.handinglian.task.mapper;

import com.handinglian.servicerecord.dto.TaskIndexDto;
import com.handinglian.task.dto.AssignAppDto;
import com.handinglian.task.dto.AssignDto;
import com.handinglian.task.dto.TaskInfoDto;
import com.handinglian.task.dto.TaskUserNumDto;
import com.handinglian.task.entity.TaskInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.Date;
import java.util.List;

@Mapper
public interface TaskInfoMapper {
    int deleteByPrimaryKey(Integer taskId);

    int insert(TaskInfo record);

    int insertOrUpdate(TaskInfo record);

    int insertOrUpdateSelective(TaskInfo record);

    int insertSelective(TaskInfo record);

    TaskInfo selectByPrimaryKey(Integer taskId);

    int updateByPrimaryKeySelective(TaskInfo record);

    int updateByPrimaryKey(TaskInfo record);

    int updateBatch(List<TaskInfo> list);

    int batchInsert(@Param("list") List<TaskInfo> list);

    List<TaskInfoDto> findTaskInfo(@Param("titleOrDesc") String titleOrDesc, @Param("startDate") Date startDate, @Param("endDate") Date endDate, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder, @Param("departmentIds") List<Integer> departmentIds);

    List<AssignDto> inquireAssignPageList(@Param("valid") Integer valid, @Param("taskId") Integer taskId, @Param("customerNameOrPhone") String customerNameOrPhone, @Param("userNameOrJobNum") String userNameOrJobNum, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder, @Param("intentionList") List<Integer> intentionList);

    List<AssignAppDto> inquireAssignAppList(@Param("userId") Integer userId, @Param("taskId") Integer taskId, @Param("customerNameOrPhone") String customerNameOrPhone, @Param("userTagId") Integer userTagId);

    List<AssignAppDto> listAssignAppDto(@Param("userId") Integer userId, @Param("taskIds") List<Integer> taskIds);

    List<TaskUserNumDto> inquireTaskUserNum();

    List<TaskInfoDto> listTaskInfoDto(@Param("userId") Integer userId, @Param("taskTitle") String taskTitle);

    Integer count();

    List<TaskInfo> findByTaskIdIn(@Param("taskIdCollection") Collection<Integer> taskIdCollection);

    List<TaskInfo> find();

    List<TaskInfo> findByDepartmentIdIn(@Param("departmentIdCollection") Collection<Integer> departmentIdCollection);

    List<TaskIndexDto> listTaskIndexDto();

    Integer countCustomer();
}